#ifndef LSCOMMAND_HPP
#define LSCOMMAND_HPP
#include <string>
using std::string;
#include <list>
using std::list;
#include <vector>
using std::vector;

class LsCommand
{
public:
	LsCommand();
	LsCommand(string cmd);
	LsCommand(vector<string> tokens, string pwd);
	string toCommand() const;
	
	void getFieldsNeeded(list<string> &fields) const;
	
	// FIXME: Get rid of this (multi-arg ls has more than one path)
	string getPath() const;
	
	vector<string> getPaths() const;
	void setPaths(vector<string> paths);
	
	bool getShowHidden() const;
	void setShowHidden(bool showHidden);
	
	bool getIsDetailed() const;
	void setIsDetailed(bool detailed);
	
	enum SortOrder {
		sortByName = 0,
		sortBySize = 1,
		sortReverse = 0x8000,
	};
	SortOrder getSortOrder() const;
	void setSortOrder(SortOrder order);
	
protected:
	void initFromTokens(vector<string> &tokens, string pwd);
	
	vector<string> paths;
	bool showHiddenFiles;
	bool detailView;
	SortOrder sortOrder;
};

#define LS_MAX_COLUMNS 6

#endif
